/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.eurotrader.converters;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;

/**
 *
 * @author Usuário
 */
public class ConvertePorcentagem implements Converter {

    public Object getAsObject(FacesContext arg0, UIComponent arg1, String str) {

    
        if(str != null){
            String str1 = str.replace(",", ".");
            return str1;
        }
        return null;

    }

    public String getAsString(FacesContext arg0, UIComponent arg1, Object valor) {
      
        if(valor!= null){
            String str = valor.toString().replace(".", ",");
            return str;
        }
        return  null;
    }

}
